<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{

    /**
     * Run the migrations.
     * 用户账户信息表
     * @return void
     */
    public function up()
    {
        Schema::create('users', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('username', 50);
            $table->string('password', 120);
            $table->string('email', 60);
            $table->string('realname', 50)->nullable();
            $table->string('sex', 1)->enum('F', 'M', 'S')->default('S');
            $table->date('birthday')->nullable();
            $table->string('nickname', 50)->nullable();
            $table->boolean('active', 1)->default(true);
            $table->string('remember_token', 60)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
